package com.yootk.processor;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;

@Component
public class MessageBeanPostProcessor implements BeanPostProcessor {
    private static final Logger LOGGER = LoggerFactory.getLogger(MessageBeanPostProcessor.class) ;
    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        LOGGER.info("【postProcessBeforeInitialization之前】Bean={},beanName={}",bean,beanName);
        return bean ;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        LOGGER.info("【postProcessAfterInitialization之后】Bean={},beanName={}",bean,beanName);
        return bean ;
    }
}
